package com.zhentao.controller;

import com.zhentao.mapper.CashierFlowMapper;
import com.zhentao.pojo.CashierFlow;
import com.zhentao.service.CashierFlowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/shouyinliushui")
public class ShouYinLiuShuiController {
    @Autowired
    private CashierFlowService cashierFlowService;
    @Autowired
    private CashierFlowMapper cashierFlowMapper;
    @RequestMapping("/addShouYinLiuShui")
    public String addShouYinLiuShui(CashierFlow cashierFlow){
        int i = cashierFlowMapper.insert(cashierFlow);
        return i>0?"添加成功":"添加失败";
    }
    @RequestMapping("/deleteShouYinLiuShui")
    public String deleteShouYinLiuShui(Integer id){
        int i = cashierFlowMapper.deleteById(id);
        return i>0?"删除成功":"删除失败";
    }
    @RequestMapping("/updateShouYinLiuShui")
    public String updateShouYinLiuShui(CashierFlow cashierFlow){
        int i = cashierFlowMapper.updateById(cashierFlow);
        return i>0?"修改成功":"修改失败";
    }
    @RequestMapping("/getShouYinLiuShuiById")
    public CashierFlow getShouYinLiuShuiById(Integer id){
        return cashierFlowMapper.selectById(id);
    }
}
